cmake_minimum_required(VERSION 3.16)

project(XDiskClient VERSION 0.1 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(Libevent REQUIRED)
find_package(protobuf REQUIRED)
include_directories(src)
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
macro(set_runtime_name target)
    if(CMAKE_BUILD_TYPE STREQUAL "Release")
        set_target_properties(${target} PROPERTIES
            RUNTIME_OUTPUT_NAME ${target}
        )
    elseif(CMAKE_BUILD_TYPE STREQUAL "Debug")
        set_target_properties(${target} PROPERTIES
            RUNTIME_OUTPUT_NAME ${target}d
        )
    endif()
endmacro()
macro(set_out_path target)
    # release
    set_target_properties(${target} PROPERTIES
        RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
    )
    set_target_properties(${target} PROPERTIES
        LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
    )
    set_target_properties(${target} PROPERTIES
        ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib
    )
endmacro()

add_subdirectory(src)
# add_subdirectory(lx)